package unicall.em.dtos;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

import unicall.em.utils.StringUtil;



/**
 * @author jinchaoyang
 */
public class MediaDto {
    
    private String id;
    
    private String tenantId;
    
    @NotEmpty(message="名称不能为空")
    @Size(max=16,message="名称不能超过16个字符")
    private String name;
   
    @NotEmpty(message="语音文件不能为空")
    private String fileName;
   
    @NotEmpty(message="类型不能为空")
    private String category;
    
    private String fileId;
    
    private Date createdAt;
    
    private Date updatedAt;
    
    private String creatorId;
    
    private String operatorId;
    
    private String state;
    
    private String auditedAt;
    
    private String auditResult;
    
    private String reason;
    
    //文件在第三方平台的名字
    private String fileAliasName;
    
    public MediaDto(){
        
    }
    

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(String creatorId) {
        this.creatorId = creatorId;
    }

    public String getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(String operatorId) {
        this.operatorId = operatorId;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getAuditedAt() {
        return auditedAt;
    }

    public void setAuditedAt(String auditedAt) {
        this.auditedAt = auditedAt;
    }

    public String getAuditResult() {
        return auditResult;
    }

    public void setAuditResult(String auditResult) {
        this.auditResult = auditResult;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }
    
    public String getFileAliasName() {
        return fileAliasName;
    }


    public void setFileAliasName(String fileAliasName) {
        this.fileAliasName = fileAliasName;
    }


    public String getCategoryName(){
        Map<String,String> options = new HashMap<String,String>();
        options.put("welcome", "欢迎语");
        options.put("queue", "排队");
        options.put("error", "错误异常");
        options.put("other", "其它");
        return StringUtil.trim(options.get(this.category));
    }

    public String getStateName(){
        Map<String,String> options = new HashMap<String,String>();
        options.put("ready", "待同步");
        options.put("rsync", "已同步");
        options.put("error", "同步错误");
        options.put("readyAudit","待审核");
        options.put("notPass","审核未通过");
        options.put("pass","已审核");
        return StringUtil.trim(options.get(this.getState()));
    }
    
    
    
    
    
    

}
